<?php
/**
 * 管理员账号更新到数据库
 * User: wuz
 * Date: 2016/8/16
 * Time: 22:11
 */
$adminNo=$_GET['userId'];///获取编辑之后的管理员id号
$adminName     = $_POST['username'];
$adminPassword = $_POST['password'];
$adminIp         = $_SERVER['REMOTE_ADDR']; //获取当前用户的IP
$adminEnrollDate = date('y-m-d h:i:s', time());
header("content-type:text/html;charset=utf-8");
include "../Mysql/MySqlClass.php";
$MySQL  = new Ycf\Lession\MySqlClass\MySqlClass('jinling_company', 'root', '123456');
$update = array(
    'adminName'       => $adminName,
    'adminPassword'   => $adminPassword,
    'adminEnrollDate' => $adminEnrollDate,
    'adminState'      => '1',
    'adminEnrollIp'   => $adminIp,
);
$MySQL->update("admin", $update,$where=array('id'=>$adminNo));
header("Location: ../userList.php"); //跳转要注意路径
